package com.vxb.testmvp.mvp_test;

import android.os.Handler;

/**
 * Created by sunjiaxing on 2017/2/12.
 */

public class UserInfoPresenter implements UserInfoContract.Presenter {

    private UserInfoContract.View view;

    public UserInfoPresenter(UserInfoContract.View view) {
        this.view = view;
    }

    @Override
    public void loadUserInfo() {
        String userId = view.loadUserId();
        view.showLoading();
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                UserInfoModel userInfoModel = new UserInfoModel("小宝", 1, "杭州");
                view.showUserInfo(userInfoModel);
                view.dismissLoading();
            }
        }, 3000);
    }

    @Override
    public void start() {
        loadUserInfo();
    }
}
